const express = require('express');
const router = express.Router();
const notificationController = require('../controllers/notificationController');
const { authenticateToken } = require('../middleware/auth');

// 所有通知接口都需要用户认证
router.use(authenticateToken);

// 获取用户通知列表
router.get('/', notificationController.getNotifications);

// 获取未读通知数量
router.get('/unread-count', notificationController.getUnreadCount);

// 标记通知为已读
router.put('/:id/read', notificationController.markAsRead);

// 标记所有通知为已读
router.put('/read-all', notificationController.markAllAsRead);

// 删除通知
router.delete('/:id', notificationController.deleteNotification);

// 清空已读通知
router.delete('/clear-read', notificationController.clearReadNotifications);

module.exports = router;

